/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI;

import java.awt.Color;
import java.util.Date;

/**
 *
 * @author Daniel
 */
public class RegistroActividadesEmpleado extends javax.swing.JInternalFrame {
Date fechaSistema;
    /**
     * Creates new form EmpleadoActividadesGUI
     */
    public RegistroActividadesEmpleado() {
        initComponents();
        Date fechaSistema= new Date();
        this.getContentPane().setBackground(new Color(153, 0, 0));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jpInfoProveedor = new javax.swing.JPanel();
        jtfFecha = new javax.swing.JTextField();
        jtfActividad = new javax.swing.JTextField();
        jllIconoProveedor = new javax.swing.JLabel();
        jbEliminar = new javax.swing.JButton();
        jbCancelar = new javax.swing.JButton();
        jbAgregar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtActividades = new javax.swing.JTable();
        jdcSelectorFecha = new com.toedter.calendar.JDateChooser();
        jcbProveedores = new javax.swing.JComboBox();
        jcbProveedores1 = new javax.swing.JComboBox();

        setClosable(true);
        setIconifiable(true);
        setTitle("OM Maribetza - Registro de Actividades.");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/SIPE-ICON.png"))); // NOI18N

        jPanel1.setBackground(new java.awt.Color(153, 0, 0));

        jpInfoProveedor.setBackground(new java.awt.Color(255, 255, 255));
        jpInfoProveedor.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        jtfFecha.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jtfFecha.setToolTipText("Escribe la dirección del proveedor");
        jtfFecha.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true), "Pago", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 12))); // NOI18N

        jtfActividad.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
        jtfActividad.setToolTipText("Aqui va el telefono del proveedor");
        jtfActividad.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true), "Actividad", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 0, 12))); // NOI18N

        jllIconoProveedor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/customer.png"))); // NOI18N

        jbEliminar.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jbEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/menos.png"))); // NOI18N
        jbEliminar.setText("Eliminar");
        jbEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbEliminarActionPerformed(evt);
            }
        });

        jbCancelar.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jbCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/Cancel.png"))); // NOI18N
        jbCancelar.setText("Cancelar");
        jbCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbCancelarActionPerformed(evt);
            }
        });

        jbAgregar.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jbAgregar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Iconos/mas.png"))); // NOI18N
        jbAgregar.setText("Agregar");
        jbAgregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAgregarActionPerformed(evt);
            }
        });

        jScrollPane1.setBackground(new java.awt.Color(115, 29, 29));

        jtActividades.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Actividad", "Pago", "Fecha"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                true, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(jtActividades);
        if (jtActividades.getColumnModel().getColumnCount() > 0) {
            jtActividades.getColumnModel().getColumn(0).setPreferredWidth(300);
            jtActividades.getColumnModel().getColumn(1).setPreferredWidth(100);
        }

        jdcSelectorFecha.setBackground(new java.awt.Color(255, 255, 255));
        jdcSelectorFecha.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 51, 0), 3, true), "Fecha de la actividad"));
        jdcSelectorFecha.setDate(fechaSistema);
        jdcSelectorFecha.setDateFormatString("yyyy/MM/dd");

        jcbProveedores.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Maria", "Lupe", "Pedro", "Juan", "Martin", "Jose", "Alejandra" }));

        jcbProveedores1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Maria", "Lupe", "Pedro", "Juan", "Martin", "Jose", "Alejandra" }));

        javax.swing.GroupLayout jpInfoProveedorLayout = new javax.swing.GroupLayout(jpInfoProveedor);
        jpInfoProveedor.setLayout(jpInfoProveedorLayout);
        jpInfoProveedorLayout.setHorizontalGroup(
            jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpInfoProveedorLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jllIconoProveedor)
                    .addComponent(jdcSelectorFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                .addGroup(jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jcbProveedores1, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jcbProveedores, javax.swing.GroupLayout.PREFERRED_SIZE, 311, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfFecha)
                    .addComponent(jtfActividad, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jpInfoProveedorLayout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(jScrollPane1)
                .addGap(12, 12, 12))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpInfoProveedorLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpInfoProveedorLayout.createSequentialGroup()
                        .addComponent(jbCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpInfoProveedorLayout.createSequentialGroup()
                        .addComponent(jbAgregar)
                        .addGap(103, 103, 103)
                        .addComponent(jbEliminar)
                        .addContainerGap())))
        );

        jpInfoProveedorLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jbAgregar, jbEliminar});

        jpInfoProveedorLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jcbProveedores, jcbProveedores1, jtfActividad, jtfFecha});

        jpInfoProveedorLayout.setVerticalGroup(
            jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpInfoProveedorLayout.createSequentialGroup()
                .addGroup(jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jpInfoProveedorLayout.createSequentialGroup()
                        .addComponent(jcbProveedores1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jcbProveedores, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addComponent(jtfActividad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jllIconoProveedor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jpInfoProveedorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jdcSelectorFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpInfoProveedor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jpInfoProveedor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbEliminarActionPerformed
        //        ControlProviders proveedor = new ControlProviders();
        //        if (validaciones()) {
            //            try {
                //                //Comprobar si el nombre del proveedor que pretendemos guardar
                //                //esta libre
                //                if (proveedor.providerExist(jtfNombre.getText())) {
                    //                    //no esta libre
                    //                    JOptionPane.showMessageDialog(this, "Ya existe un proveedor con el nombre '" + jtfNombre.getText() + "'."
                        //                            + "\n" + "Cambie el nombre para poder agregar una nueva categoria.", "Ya existe este proveedor",
                        //                            0);
                    //                    jtfNombre.requestFocus();
                    //                    jtfNombre.selectAll();
                    //                } else {
                    //                    //esta libre
                    //                    proveedor.add(
                        //                            jtfNombre.getText(),
                        //                            jtfDireccion.getText(),
                        //                            jtfTelefono.getText(),
                        //                            jtfEmail.getText());
                    //                    JOptionPane.showMessageDialog(this, "Proveedor guardado con exito.",
                        //                            "Proveedor guardado.", 1);
                    //                    //Limpiando campos de texto
                    //                    cleanFields();
                    //                }
                //            } catch (Exception e) {
                //                JOptionPane.showMessageDialog(this, "Ha ocurrido un error al guardar: "
                    //                        + "\n" + e, "Error al guardar.", 0);
                //            }
            //        } else {
            //            JOptionPane.showMessageDialog(this, mensajeVal);
            //        }
    }//GEN-LAST:event_jbEliminarActionPerformed

    private void jbCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbCancelarActionPerformed
        this.dispose();// TODO add your handling code here:
    }//GEN-LAST:event_jbCancelarActionPerformed

    private void jbAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAgregarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jbAgregarActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JButton jbAgregar;
    private javax.swing.JButton jbCancelar;
    private javax.swing.JButton jbEliminar;
    private javax.swing.JComboBox jcbProveedores;
    private javax.swing.JComboBox jcbProveedores1;
    private com.toedter.calendar.JDateChooser jdcSelectorFecha;
    private javax.swing.JLabel jllIconoProveedor;
    private javax.swing.JPanel jpInfoProveedor;
    private javax.swing.JTable jtActividades;
    private javax.swing.JTextField jtfActividad;
    private javax.swing.JTextField jtfFecha;
    // End of variables declaration//GEN-END:variables
}
